import 'package:flutter/services.dart';

void sendByte() {
  var send = ByteData(10);
  send.setUint8(0, 0);
  send.setUint8(1, 1);
  send.setUint8(2, 2);
  send.setUint8(3, 3);
  send.setUint8(4, 4);
  send.setUint8(5, 5);
  send.setUint8(6, 6);
  send.setUint8(7, 7);
  send.setUint8(8, 8);
  send.setUint8(9, 9);
  ServicesBinding.instance.defaultBinaryMessenger.send("CHANNEL_BINARY", send);
}

void initBinaryMessenger() {
  ServicesBinding.instance.defaultBinaryMessenger.setMessageHandler("CHANNEL_BINARY", (ByteData? message) async {
    print("Binary: $message");
    return null;
  });
}
